﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace SkypeDialer.Configuration
{
    public class OutOfBoxCRMConfigurationProvider: ICrmDataAdapterConfigurationProvider
    {
        #region ICrmDataAdapterConfigurationProvider Members

        public Dictionary<string,ContactInfoEntity> ContactInfoEntities
        {
            get 
            {
                Dictionary<string, ContactInfoEntity> cie = new Dictionary<string, ContactInfoEntity>();

                // lead
                cie.Add("lead", new ContactInfoEntity()
                {
                    EntityName = "lead",
                    ContactInfoAttributes = new List<ContactInfoAttribute>()
                    {
                        new ContactInfoAttribute("telephone1", true, false, false, false, false),
                        new ContactInfoAttribute("telephone2", true, false, false, false, false),
                        new ContactInfoAttribute("telephone3", true, false, false, false, false),
                        new ContactInfoAttribute("mobilephone", true, false, false, true, false)
                    }
                });

                // contact
                cie.Add("contact", new ContactInfoEntity()
                {
                    EntityName = "contact",
                    ContactInfoAttributes = new List<ContactInfoAttribute>()
                    {
                        new ContactInfoAttribute("telephone1", true, false, false, false, false),
                        new ContactInfoAttribute("telephone2", true, false, false, false, false),
                        new ContactInfoAttribute("telephone3", true, false, false, false, false),
                        new ContactInfoAttribute("mobilephone", true, false, false, true, false)
                    }
                });

                // account
                cie.Add("account", new ContactInfoEntity()
                {
                    EntityName = "account",
                    ContactInfoAttributes = new List<ContactInfoAttribute>()
                    {
                        new ContactInfoAttribute("telephone1", true, false, false, false, false),
                        new ContactInfoAttribute("telephone2", true, false, false, false, false),
                        new ContactInfoAttribute("telephone3", true, false, false, false, false)
                    }
                });

                // phonecall
                cie.Add("phonecall", new ContactInfoEntity()
                {
                    EntityName = "phonecall",
                    ContactInfoAttributes = new List<ContactInfoAttribute>()
                    {
                        new ContactInfoAttribute("phonenumber", true, false, false, false, false)
                    }
                });

                return cie;
            }
        }

        #endregion
    }
}